<!DOCTYPE html>
<html>
<head>
  <title><%= content_for?(:title) ? yield(:title) : 'Catlog2' %></title>
  <%= stylesheet_link_tag    'admin', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'admin', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>
<body>
<nav class="tm-navbar uk-navbar uk-navbar-attached app-navbar">
  <div class="uk-container uk-container-center uk-clearfix">

    <%= link_to '博客后台', admin_root_path, class: 'uk-navbar-brand uk-hidden-small' %>

    <ul class="uk-navbar-nav">
      <%= content_tag :li, link_to('文章', admin_posts_path), class: (controller_name == 'posts' && action_name == 'index' ? 'uk-active' : '') %>
      <%= content_tag :li, link_to('文章回收站', index_trash_admin_posts_path), class: (controller_name == 'posts' && action_name == 'index_trash' ? 'uk-active' : '') %>
      <%= content_tag :li, link_to('写文', new_admin_post_path), class: (controller_name == 'posts' && action_name == 'new' && 'uk-active'), 'data-no-turbolink' => '' %>
      <%= content_tag :li, link_to('设置', category_admin_settings_path), class: (controller_name == 'settings' ? 'uk-active' : '') %>
    </ul>

    <ul class="uk-navbar-nav uk-float-right">
      <%= content_tag :li, link_to('注销', admin_sign_out_path, method: :delete) %>
    </ul>
  </div>
</nav>

<div id="main">
  <div class="uk-container uk-container-center">
    <%= yield %>
  </div>
</div>

</body>
</html>
